/*
{
"状态":1,
"名称":"获取-供应商记录总数",
"作者":"陈泽椿",
"创建时间":"2018-06-30",
"功能":"获取-供应商记录总数",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/
declare @sql varchar(max)
declare @supplier_name varchar(100)
declare @where varchar(max)
 
set @supplier_name = '{supplier_name}'
 
set @where = ''

if(@supplier_name <>'')
begin
	set @where += ' and (supplier_name like ''%' + @supplier_name + '%''  or supplier_no like ''%' + @supplier_name + '%'' )'
end
set @sql = '
select count(supplier_id) as cnt from b_supplier where 1 = 1 {where}'
set @sql = replace(@sql,'{where}',@where)
exec(@sql)

 